/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.fjut.se16.aop;

import edu.fjut.se16.aop.entiy.User;
import edu.fjut.se16.aop.service.ProductService;
import edu.fjut.se16.aop.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 *
 * @author danny
 */
public class AOPClient {
    public static void main(String[] args) {
        // 获取应用上下文
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        // 从ctx中获取bean
//        UserService bean = ctx.getBean(UserService.class);
//        bean.addUser(new User());
        ProductService ps = ctx.getBean(ProductService.class);
        ps.addProduct();
    }
}
